/**
 /**@author Guy Franco
*This function is a GUI function used by the Information Department Manager
*It presents the supervisor with a menu for him to pick
**/
package gui;
import javax.swing.JPanel;
import javax.swing.JLabel;
import java.awt.Font;
import java.awt.Color;
import javax.swing.JButton;

import common.ChatIF;

import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import java.util.ArrayList;


public class InformationDepartmentManagerPanel extends JPanel implements ChatIF{
	AcademicFrame frame;
	AssessorPanel assessor;
	MainWindow mainWindow;
	private InformationDepartmentManagerPanel myself;
	
	public InformationDepartmentManagerPanel(AcademicFrame frame, MainWindow mainWindow){
		super();
		this.frame=frame;
		this.mainWindow=mainWindow;
		this.myself = this;
		frame.setSize(500, 400);
		initialize();
	}
	
	private void initialize() {
		setLayout(null);
		
		JLabel lblInformationDepartmentManager = new JLabel("Information Department Manager");
		lblInformationDepartmentManager.setForeground(Color.BLUE);
		lblInformationDepartmentManager.setFont(new Font("Tahoma", Font.BOLD, 24));
		lblInformationDepartmentManager.setBounds(21, 34, 419, 29);
		add(lblInformationDepartmentManager);
		
		JButton btnStatistics = new JButton("Statistics and Reports");
		btnStatistics.setBounds(134, 295, 176, 23);
		add(btnStatistics);
		
		JButton btnManageRequest = new JButton("Observe requests");
		btnManageRequest.addActionListener(new ActionListener()
		{
			public void actionPerformed(ActionEvent e)
			{
				ArrayList<Object> command = new ArrayList<Object>();
				command.add("getListOfAllRequests");
				frame.setContentPane(new ManageRequestPanel(frame, myself,false,""));
				frame.setSize(460, 420);
				AcademicFrame.myclient.sendMessageToServer(command);
			}
		});
		btnManageRequest.setBounds(134, 132, 176, 23);
		add(btnManageRequest);
		
		JButton btnBack = new JButton("Back");
		btnBack.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				frame.setSize(500, 500);
				frame.setContentPane(mainWindow);
			}
		});
		btnBack.setBounds(174, 346, 89, 23);
		add(btnBack);
		
		JButton btnObserveEmployees = new JButton("Manage employees");
		btnObserveEmployees.addActionListener(new ActionListener() 
		{
			public void actionPerformed(ActionEvent e) 
			{
				frame.setContentPane(new ManageEmployeesPanel(frame,myself));
				frame.setSize(650,500);
				
				ArrayList<Object> getListOfEmployees = new ArrayList<Object>();
				getListOfEmployees.add("getListOfEmployees");
				AcademicFrame.myclient.sendMessageToServer(getListOfEmployees);
				
			}
		});
		btnObserveEmployees.setBounds(134, 89, 176, 23);
		add(btnObserveEmployees);
		
		JButton btnNewButton = new JButton("Observe Assessments");
		btnNewButton.addActionListener(new ActionListener()
		{
			public void actionPerformed(ActionEvent arg0)
			{
				
				ArrayList<Object> command = new ArrayList<Object>();
				command.add("getListOfAllAssessments");		
				frame.setContentPane(new ObserveAssessmentPanel(frame,myself));
				frame.setSize(650,500);		
				AcademicFrame.myclient.sendMessageToServer(command);
			}
		});
		btnNewButton.setBounds(134, 176, 176, 23);
		add(btnNewButton);
		
		JButton btnNewButton_1 = new JButton("Observe Executions");
		btnNewButton_1.addActionListener(new ActionListener()
		{
			public void actionPerformed(ActionEvent e)
			{
				ArrayList<Object> command = new ArrayList<Object>();
				command.add("getListOfAllExecutions");			
				frame.setContentPane(new ObserveExecutionPanel(frame,myself));
				frame.setSize(650,500);
				AcademicFrame.myclient.sendMessageToServer(command);
			
			}
		});
		btnNewButton_1.setBounds(134, 223, 176, 23);
		add(btnNewButton_1);
	}

	@Override
	public void display(Object message) {
		// TODO Auto-generated method stub
		
	}
}
